package domain.shop;

import domain.AbstractEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.xml.bind.annotation.XmlTransient;

/**
 * Attribute of particulary product.
 */

@Entity
public class Attribute extends AbstractEntity {
    @Column(name = "ATTRIBUTE_NAME")
    private String name = "";
    @Column(name = "ATTRIBUTE_VALUE")
    private String value = "";
    private String unit = "";
    @Column(name = "ATTRIBUTE_INDEX")

    private Integer index = 0;

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    @ManyToOne
    private Product product;

    public Attribute() {
    }

    @XmlTransient
    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}

